

<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/js/media/css/demo_table_jui.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/js/examples_support/themes/smoothness/jquery-ui-1.8.4.custom.css" />
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        oTable = $('#example').dataTable({
            "bJQueryUI": true,
            "sPaginationType": "full_numbers"
        });
    });
</script>
<?php if (!empty($slider)) { ?>
    <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
        <thead>
            <tr>
                <th>Tiêu đề</th>
                <th>Ngày hết hạn</th>
                <th>Trạng thái</th>
                <th>Xóa</th>
            </tr>
        </thead>
        <tbody>
            <?php
            //include 'encode_decode.php';

            Yii::import('application.controllers.home.encode_decode');
            $md = new encode_decode();
            if (!empty($slider)) {
                foreach ($slider as $item) {
                    $ma = $md->encrypt($item->id);
                    ?>
                    <tr class="gradeA">
                        <td>

                            <?php echo '<a style="text-decoration: none" href="' . Yii::app()->request->baseUrl . '/xem-slider/' . $ma . '">' . $item->title . '</a>' ?>
                        </td>

                        <td class="center"><?php 
                        $date = new DateTime($item->dateExpend);

                        echo $date->format('Y-m-d'); 
                        ?></td>
                        <td class="center">
                            <?php
                            if ($item->flag > 1) {
                                echo 'đã xóa';
                            } elseif ($item->flag > 0) {
                                echo 'đang hiện';
                            } else {
                                echo 'đang ẩn';
                            }
                            ?>
                        </td>
                        <td class="center">
                            <?php echo '<a style="text-decoration: none;color: red" href="' . Yii::app()->request->baseUrl . '/xoa-slider/' . $ma . '">' . 'Xóa</a>' ?>
              
                        </td>
                    </tr>
                    <?php
                }
            }
            ?>
        </tbody>
    </table>
    <?php
} else {
    echo 'Bạn chưa có slider nào!';
}